package com.spider.demo4test;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class CollectionsDemo2 {
    public static void main(String[] args) {
        //目标：Collections 工具类
        List<String> list = new ArrayList<>();
        //addAll 方法
        Collections.addAll(list,"张三","王五","赵六","小王","小张");
        System.out.println(list);
        Collections.reverse(list);//反转
        System.out.println(list);
        Collections.shuffle(list);//随机排序
        System.out.println(list);
    }
}
